package com.bdqn.controller;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/employee")
public class EmployeeController {


    //访问该方法需要超级管理员的角色
    @RequiresRoles(value = {"超级管理员"})
    @RequestMapping("/find")
    public String find(){
        return "查询员工信息";
    }
    //访问该方法需要超级管理员的角色或经理的角色
    @RequiresRoles(value = {"超级管理员","经理"},logical = Logical.OR)
    @RequestMapping("/add")
    public String add(){
        return "添加员工信息";
    }

    //访问该方法需要删除用户的权限
    @RequiresPermissions(value = {"user:delete"})
    @RequestMapping("/delete")
    public String delete(){
        return "删除员工信息";
    }

}